package com.smt.ejb3;

import javax.naming.InitialContext;


public class PersonClient {
	public static void main(String[] args) {
		try {
			InitialContext ctx = new InitialContext();

			PersonManager service = (PersonManager) ctx
				.lookup("PersonManagerBean/remote");
			
			/* Test save one at a time */
			
//			Man m = new Man();
//			m.setName("old sun");
//			
//			Woman w = new Woman();
//			w.setName("Lina");
//						
//			service.saveMan(m);
//			service.saveWoman(w);
			
			/* Test save and roll back */
			service.saveAndThrowException();
			

		} catch (Exception ex) {
			
			ex.printStackTrace();
		}
	}
	
}
